
<div class="box box-info">
    <div class="box-header with-border">
        <h3 class="box-title">订单号：{{ $comboOrder->outTradeNo }}</h3>
        <div class="box-tools">
            <div class="btn-group pull-right" style="margin-right: 10px">
                <a href="{{ url('/administrator/order') }}" class="btn btn-sm btn-default"><i class="fa fa-list"></i> 列表</a>
            </div>
        </div>
    </div>
    <div class="box-body">
        <table class="table table-bordered">
            <tbody>
            <tr>
                <td>买家：</td>
                <td>{{ $comboOrder->member->nickname }}</td>
                <td>手机号:</td>
                <td>{{$comboOrder->member->mobile}}</td>
                <td>支付时间：</td>
                <td>{{ $comboOrder->created_at }}</td>
            </tr>
            <tr>
                <td>商品名称</td>
                <td>{{$payOrder->body}}</td>
                <td>单价</td>
                <td>{{$comboOrder->combo_price}}</td>
                <td>数量</td>
                <td>{{$comboOrder->total_num}}</td>
            </tr>
            <tr>
                <td>推广人</td>
                @php
                 $leader= \App\Member::find($comboOrder->member->pid);
                @endphp
                <td>@if($leader)昵称:{{$leader->nickname}} 手机号:{{$leader->mobile}} @else 无推广人@endif</td>
                <td>获得推广金额</td>
                <td>{{round($comboOrder->combo->rate*$comboOrder->price/100,2)}}</td>
            </tr>
            <tr>
                <td>订单金额：</td>
                <td colspan="3">￥{{ $comboOrder->price }}</td>
            </tr>

@if($comboOrder->is_refund==0&&\Encore\Admin\Facades\Admin::user()->can('refund'))
            <tr>
                <td>
                    <form action="{{route('order.refund',[$comboOrder->id])}}" method="post"  id="from">
                    <label for="express_no" class="control-label">是否退掉佣金</label>
                    {{csrf_field()}}
                    <div class="switch" data-on="primary" data-off="info">
                        <input type="checkbox" checked name="distribute" />
                    </div>
                    </form>

                </td>
                <td>
                    <button type="button" class="btn btn-success" id="ship-btn" >退款</button>
                </td>
            </tr>
    @else
    <tr>
        <td>订单状态</td>
        <td>已退款</td>
    </tr>
    @endif

            </tbody>
        </table>
    </div>
</div>
    <script>
        $('#ship-btn').on('click', function () {
            swal({
                    title: "确定要退票么？",
                    text: "退票",
                    type: "warning",
                    showCancelButton: true,
                    cancelButtonText: "取消！",
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "确定退票！",
                    closeOnConfirm: false,
                    closeOnCancel: true
                },
                function(isConfirm){
                    if (isConfirm) {
                        $('#from').submit();
                    } else {

                    }
                });
        });
    </script>
